﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using EbbinghausWord.BLL;
using EbbinghausWord.Entities;
using Microsoft.Phone.Controls;

namespace EbbinghausWord.Pages
{
    public partial class StudyAchievementPage : PhoneApplicationPage
    {
        public StudyAchievementPage()
        {
            InitializeComponent();

        }

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            List<WordEntity> reviewWords = null;
            List<WordEntity> achievementWords = null;
            List<WordEntity> learningWords = null;

            loadingControl.Loading(
                () =>
                {
                    reviewWords = ReviewManager.GetReviewWordBook();
                    achievementWords = WordBookManager.GetAchievementWords();
                    learningWords = WordBookManager.GetLearningWords();
                },
            () =>
            {
                reviewWordListControl.WordList = reviewWords;
                achievementWordListControl.WordList = achievementWords;
                learningWordListControl.WordList = learningWords;
            });
        }
    }
}